home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / DD3BETA1.ZIP / PACK1.PRG / TMP / DD3TIME.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-12-28  |  1.9 KB  |  95 lines

  1. unit dd3time;
  2. {Taken From SWAG}
  3. interface
  4. Const
  5.  
  6.   MDOS = 0;  { DOS               }
  7.   OS2  = 1;  { OS/2              }
  8.   WIN  = 2;  { Windows           }
  9.   DV   = 3;  { DesqView          }
  10.  
  11. Var
  12.   Ops            : Byte;    { Operating System OS/2/DOS/WIN/DV}
  13.  
  14. procedure giveslice;
  15. procedure checkos;
  16.  
  17. implementation
  18.  
  19. PROCEDURE giveslice; Assembler; {Gives up remainder of clock cycle
  20.                                  under dos, windows, os/2 }
  21.   asm
  22.     CMP ops,MDos { Compare to DOS }
  23.     JE @MSDOS    { Jump if = }
  24.     CMP ops,Dv   { Compare to Desqview }
  25.     JE @DESQVIEW { Jump if = }
  26.     CMP ops, Win { Compare to Windows }
  27.     JE @WINOS2   { Jump if = }
  28.     CMP ops, OS2 { Compart OS/2 }
  29.     JE @WINOS2   { Jump if = }
  30.     JMP @NONE    { None found, Jump to End }
  31.  
  32.  
  33.  @MSDOS:
  34.     INT 28h   { Interupt 28h }
  35.     JMP @NONE { Jump to the end }
  36.  
  37.  @DESQVIEW:
  38.     MOV ax,1000h { AX = 1000h }
  39.     INT 15h      { Call Interupt 15h }
  40.     JMP @NONE    { Jump to the end }
  41.  
  42.  @WINOS2:
  43.     MOV AX, 1680h { AX = 1680h }
  44.     INT 2Fh       { Call Interupt 2Fh for Win-OS/2 TimeSlice }
  45.  
  46.  @NONE:
  47.  
  48. end; {GiveSlice}
  49.  
  50. {***********}
  51.  
  52. PROCEDURE checkos; Assembler;
  53. { Currently Supports DesqView, Microsoft Windows and IBM's OS/2 }
  54.  
  55. asm
  56.   mov ops, MDos { Default DOS }
  57.   mov ah, 30h   { AH = 30h }
  58.   int 21h  { dos version }
  59.   cmp al, 14h
  60.   jae @IBMOS2 { Jump if >= to 20 }
  61.  
  62.  
  63.   mov ax,2B01h
  64.   mov cx,4445h
  65.   mov dx,5351h
  66.   int 21h { Desqview Installed? }
  67.   cmp al, 255
  68.   jne @DesqView { Jump if AL <> 255 }
  69.  
  70.   mov ax,160Ah
  71.   int 2Fh { Windows Install?}
  72.   cmp ax, 0h
  73.   je @Windows { If = Jump to Windows }
  74.   jmp @Finish { Nothing found, go to the end }
  75.  
  76. @IBMOS2:
  77.   mov Ops, Os2  { Set OS Value }
  78.   jmp @Finish
  79.  
  80. @DesqView:
  81.   mov ops, Dv   { Set OS Value }
  82.   jmp @Finish
  83.  
  84. @Windows:
  85.   mov ops, win  { Set OS Value }
  86.   jmp @Finish
  87.  
  88. @FINISH:
  89. end; { checkos }
  90.  
  91.  
  92. begin
  93. end.
  94.  
  95.